# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Norberto Lopes <shelika@mail.telepac.pt>

pkgname=wanderlust
pkgver=20221010
_commit=d99ffe08649aa2f7e781e701b39d7aba2bcdc183
pkgrel=1
pkgdesc="Mail/News reader supporting IMAP4rev1 for emacs."
arch=(any)
url="https://github.com/wanderlust/wanderlust/"
license=('GPL')
depends=('emacs' 'emacs-apel>=10.7' 'flim' 'semi')
makedepends=('git' 'texinfo')
#optdepends=('bbdb: contact management utility')
install=wanderlust.install
source=("wanderlust::git+https://github.com/wanderlust/wanderlust.git#commit=${_commit}")
sha256sums=('SKIP')

package() {
  cd "$srcdir"/wanderlust
  mkdir -p ~/.emacs.d/elpa
  PIXMAPDIR=/usr/share/emacs/`emacs -batch -eval "(princ (format \"%d.%d\" emacs-major-version emacs-minor-version))"`/etc/wl/icons/
  install -dm0755 "$pkgdir"/usr/share/info
  make all info
  make install install-info \
	LISPDIR="$pkgdir"/usr/share/emacs/site-lisp \
	PIXMAPDIR="$pkgdir"$PIXMAPDIR \
	INFODIR="$pkgdir"/usr/share/info
  install -m644 utils/ssl.el "$pkgdir"/usr/share/emacs/site-lisp/ssl.el
}
